<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:x="http://xseam.dev.java.net/seam"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      template="/layout/template.xhtml">
      
	<ui:define name="body">
	
		<h2>Cadastrar saída</h2>
		<hr style="color: #666666;width: 700px;float: left;"/>
		<br />
		<br />
	
		<x:form id="saidaForm" showMessages="true">
		
			<x:selectOneMenu id="inDocente" items="#{factoryDocentes}" value="#{saida.docente}" label="Docente: " required="true"> 
				<ui:insert />
				<s:selectItems label="#{_docente.nome}" itemValue="#{_docente}" var="_docente" value="#{factoryDocentes}" noSelectionLabel="Selecione..."/>
				<s:convertEntity />
				<ui:insert />
			</x:selectOneMenu>
			<br class="clear" />
			
			<x:inputText id="inSaida" 
				label="Ano saida: " value="#{saida.anoSaida}" maxlength="4" size="15" required="true"/>
			<br class="clear" />
			
			<x:inputText id="inCreditos" 
				label="Créditos saida: " value="#{saida.creditosSaida}" maxlength="4" size="15" required="true"/>
			<br class="clear" />
			
			<x:selectOneMenu id="inTipo" items="#{factoryTipoSaida}" value="#{saida.tipoSaida}" label="Saída: " required="true"> 
				<ui:insert />
				<f:selectItem itemLabel="Selecione" itemValue=""/>
				<s:selectItems label="#{enumObj.description}" itemValue="#{enumObj.value}" var="enumObj" value="#{factoryTipoSaida}" />
				<ui:insert />
			</x:selectOneMenu>
			<br class="clear" />
			
			<x:selectOneMenu id="inSemestre" items="#{factorySemestre}" value="#{saida.semestreSaida}" label="Semestre: " required="true"> 
				<ui:insert />
				<f:selectItem itemLabel="Selecione" itemValue=""/>
				<s:selectItems label="#{enumObj.description}" itemValue="#{enumObj.value}" var="enumObj" value="#{factorySemestre}" />
				<ui:insert />
			</x:selectOneMenu>
			<br class="clear" />
			
			<s:div styleClass="actionButtons">
				<h:commandButton id="btnIncluir" 
					value="Cancelar" action="RESULT_BACK" immediate="true" title="Pressione aqui para cancelar."/>
					
				<h:commandButton id="btnPesquisar" 
					value="Salvar" action="#{saidaAction.salvar()}" title="Pressione aqui para realizar o cadastro."
					onclick="return confirmarOperacao();" />
			</s:div>
		
		</x:form>
		
	</ui:define>
	
</ui:composition>